Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose position prop in DotTip component #14972

Merged
merged 9 commits into from Jul 11, 2019
Merged

Expose position prop in DotTip component #14972

merged 9 commits into from Jul 11, 2019

Conversation

HardeepAsrani
Copy link
Contributor

@HardeepAsrani HardeepAsrani commented Apr 13, 2019

Description

This will expose the position prop in DotTip component which uses Popove component internally to make the popover.

How has this been tested?

It was tested with the default DotTip that are being used for NUX. It's worth mentioning that the positioning will only take place if space is available for it (it drove me mad because I thought it wasn't working).

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

Fixes #14923

@youknowriad youknowriad added Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code [Feature] NUX Anything that impacts the new user experience labels Apr 15, 2019
@aduth
Copy link
Member

aduth commented Apr 24, 2019

I might like to know if there was some design rationale from the original implementation (#6631, #3670) for which the position would have been hard-coded. Adding "Needs Design Feedback".

@aduth aduth added the Needs Design Feedback Needs general design feedback. label Apr 24, 2019
@mapk mapk requested a review from karmatosed June 25, 2019 16:41
@karmatosed
Copy link
Member

I have done some digging into this and the reasoning isn't clear so I think based on that it should be likely to work exposing. I will cc in @noisysocks also as one of the originators of a lot of Tips code.

@noisysocks
Copy link
Member

noisysocks commented Jul 4, 2019

I have done some digging into this and the reasoning isn't clear so I think based on that it should be likely to work exposing. I will cc in @noisysocks also as one of the originators of a lot of Tips code.

The rationale was that I didn't need it so I didn't add it! 😀

It's worth mentioning that the positioning will only take place if space is available for it (it drove me mad because I thought it wasn't working).

This has bitten me before too! 😂

@@ -33,7 +34,7 @@ export function DotTip( {
return (
<Popover
className="nux-dot-tip"
position="middle right"
position={ position || 'middle right' }
Copy link
Member

@noisysocks noisysocks Jul 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do this with a default argument if you want to make it more explicit that the argument is optional.

export function DotTip( {
	position = 'middle right',
	...
} ) {
	...

Totally up to you, though!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do this with a default argument if you want to make it more explicit that the argument is optional.

I'd agree this would probably be the best way to communicate it as an optional prop, and it may help future maintainability if there are changes to the component which reference position in more than this one location.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aduth Should I make this change then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aduth Should I make this change then?

It would be a worthwhile improvement if you're willing, yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aduth Made the changes. :)

@noisysocks noisysocks merged commit 99a7eb4 into WordPress:master Jul 11, 2019
@noisysocks
Copy link
Member

Thanks @HardeepAsrani!

@youknowriad youknowriad added this to the Gutenberg 6.2 milestone Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] NUX Anything that impacts the new user experience Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NUX DotTip Positioning
5 participants